Hi there,
I am trying to build a small system that uses a simple boot script as init process. Yes, I pass init=myscript to the Linux kernel, crazy thing to do but it works.
However, trying to open() on a tty fails on device not found, even if /dev/tty exists.
Here's the small script I use to the basic things like mount tmpfs, sysfs and procfs, start the udev daemon, configure the console...
Code:
#!/bin/sh
mount -t sysfs sysfs /sys
mount -t proc proc /proc
/etc/init.d/udev start >> /dev/null
setupcon
# Run sh now
/bin/sh
/etc/init.d/udev stop
umount -a
reboot -f
I know I should also add these, from the LFS manual here:
http://www.linuxfromscratch.org/lfs/...6/devices.html
Code:
mknod -m 622 /dev/console c 5 1
mknod -m 666 /dev/null c 1 3
mknod -m 666 /dev/zero c 1 5
mknod -m 666 /dev/ptmx c 5 2
mknod -m 666 /dev/tty c 5 0
mknod -m 444 /dev/random c 1 8
mknod -m 444 /dev/urandom c 1 9
chown root:tty /dev/{console,ptmx,tty}
But added these and still open() fails on /dev/tty.
I have also tried deleting /dev/tty and re-creating it again with
Code:
mknod -m 666 /dev/tty c 5 0
But still open() fails on /dev/tty.
I don't understand if /bin/sh is running on a TTY or not, because
output is empty in this enviroment, or if that is a problem at all.
Any ideas on what am I missing here, please?